﻿using System;
using System.Net;

using PowerArrow.nasa.Model;
using SilverlightCairngorm.Control;
using SilverlightCairngorm.Command;
using PowerArrow.nasa.Control;

namespace PowerArrow.nasa.Command
{
    public class BgCommand : ICommand
    {
        private PowerArrowModel model = null;

        #region ICommand Members

        public void execute(CairngormEvent cairngormEvent)
        {
            model = PowerArrowModel.Instance;
            switch (cairngormEvent.Name) {
                case PowerArrowController.SC_EVENT_PAUSE_BG:
                    model.BackgroundStatus = 1;
                    break;
                case PowerArrowController.SC_EVENT_RESUME_BG:
                    model.BackgroundStatus = 3;
                    break;
                case PowerArrowController.SC_EVENT_RUN_BG:
                    model.BackgroundStatus = 0;
                    break;
                case PowerArrowController.SC_EVENT_STOP_BG:
                    model.BackgroundStatus = 2;
                    break;
            }
        }

        #endregion
    }
}
